Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
tiny-readdir-glob
Advanced tools
A simple promisified recursive readdir function, with support for globs.
A simple promisified recursive readdir function, with support for globs.
npm install --save tiny-readdir-glob
import readdir from 'tiny-readdir-glob';
const aborter = new AbortController ();
const result = await readdir ( ['src/**/*.js'], {
depth: 20, // Maximum depth to look at
limit: 1_000_000, // Maximum number of files explored, useful as a stop gap in some edge cases
followSymlinks: true, // Whether to follow symlinks or not
ignore: ['**/.git', '**/node_modules'], // Globs, or raw function, that if returns true will ignore this particular file or a directory and its descendants
signal: aborter.signal, // Optional abort signal, useful for aborting potentially expensive operations
onDirents: dirents => console.log ( dirents ) // Optional callback that will be called as soon as new dirents are available, useful for example for discovering ".gitignore" files while searching
});
console.log ( result.directories ); // => Array of absolute paths pointing to directories, filtered by the provided glob
console.log ( result.files ); // => Array of absolute paths pointing to files, filtered by the provided glob
console.log ( result.symlinks ); // => Array of absolute paths pointing to symlinks, filtered by the provided glob
console.log ( result.directoriesFound ); // => Array of absolute paths pointing to directories, not fully filtered by the provided glob yet
console.log ( result.filesFound ); // => Array of absolute paths pointing to files, not fully filtered by the provided glob yet
console.log ( result.symlinksFound ); // => Array of absolute paths pointing to symlinks, not fully filtered by the provided glob yet
console.log ( result.directoriesFoundNames ); // => Set of directories names found
console.log ( result.filesFoundNames ); // => Set of files name found
console.log ( result.symlinksFoundNames ); // => Set of symlinks names found
console.log ( result.directoriesFoundNamesToPaths ); // => Record of directories names found to their paths
console.log ( result.filesFoundNamesToPaths ); // => Record of files name found to their paths
console.log ( result.symlinksFoundNamesToPaths ); // => Record of symlinks names found to their paths
setTimeout ( () => aborter.abort (), 10000 ); // Aborting if it's going to take longer than 10s
MIT © Fabio Spampinato
FAQs
A simple promisified recursive readdir function, with support for globs.
The npm package tiny-readdir-glob receives a total of 3,328 weekly downloads. As such, tiny-readdir-glob popularity was classified as popular.
We found that tiny-readdir-glob demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.